<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    session(['key'=>111]);
    return view('welcome');
});

Route::get('/my','ViewController@index');
Route::get('/myview','ViewController@view');
Route::get('/article','ViewController@article');
Route::get('/layout','ViewController@layout');
Route::get('/user','UserController@index');

Route::get('/test', function () {
    return session('key');
});
//配置控制器中的方法的路由
Route::group(['prefix' => 'admin','namespace'=>'Admin','middleware'=>['web','admin.login']], function () {
    Route::get('index', 'IndexController@index')->name('asd');
    Route::resource('article','ArticleController');
});

Route::group(['middleware'=>['web']],function (){
    Route::get('admin/login', 'Admin\IndexController@login');
    Route::get('admin/logout', 'Admin\IndexController@logout');
});
//
//Route::get('/ar/{id}/{name}', function ($id,$name) {
//    echo "ar".$id.$name;
//});
